package wedaex.helper;

public class RegExpEscape {
	private static String specialChars = ".|*?+(){}[]^$\\";

	public static String escape(String str) {
		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < str.length(); i++) {
			String c = str.substring(i,i+1);
			if(specialChars.contains(c))
				sb.append('\\').append(c);
			else
				sb.append(c);
		}
		return sb.toString();
	}
}
